import request from '@/utils/request'
export default {
    //获取活期基金分页列表
    getBookList(page, limit) {
        return request({
            url: `/member/books/selectAll`,
            method: 'post',
            data: {
                page:page,
                limit:limit
            }

        })
    },
    
    getbillborad() {
        return request({
            url: `/member/books/selectAllByvisits`,
            method: 'post',
            data: {
                page:1,
                limit:10
            }

        })
    },

    getbooksInfoByType(bookType) {
        return request({
            url: `/member/books/selectByType`,
            method: 'post',
            data: {
                bookType: bookType
            }

        })
    },
    selectAny(selectAnyData) {
        return request({
            url: `/member/books/selectByAny`,
            method: 'post',
            data: {
                keyword: selectAnyData
            }

        })
    },
    
    getbooksInfoByid(id) {
        return request({
            url: `/member/books/selectByid`,
            method: 'post',
            data: {
                id: id
            }

        })
    },
    addToBookshelf(bookId) {
        return request({
            url: `/member/bookshelf/insertOne`,
            method: 'post',
            data: {
                bookId: bookId,
                memberName:JSON.parse(localStorage.getItem("user")).username
            }

        })
    },
    getnewChapter(bookId) {
        return request({
            url: `/member/chapter/selectNew`,
            method: 'post',
            data: {
                id: bookId,
              
            }

        })
    },
    getChapterList(bookId) {
        return request({
            url: `/member/chapter/selectAll`,
            method: 'post',
            data: {
                bookId: bookId,
              
            }

        })
    },
    
    getcurretChapter(bookId,chapterNum)  {
        return request({
            url: `/member/chapter/selectOneByNum`,
            method: 'post',
            data: {
                bookId: bookId,
                chapterNum:chapterNum
              
            }

        })
    },
    
    getNoteList(id)  {
        return request({
            url: `/member/note/selectByCidAndUid`,
            method: 'post',
            data: {
                chapterId: id,
                memberUsername:JSON.parse(localStorage.getItem("user")).username
              
            }

        })
    },
    
    addNote(id,textarea)  {
        return request({
            url: `/member/note/addOneOne`,
            method: 'post',
            data: {
                chapterId: id,
                content: textarea,
                memberUsername:JSON.parse(localStorage.getItem("user")).username
              
            }

        })
    },
    
    getExperienceList(id)  {
        return request({
            url: `/member/experience/selectByCidAndUid`,
            method: 'post',
            data: {
                chapterId: id
              
            }

        })
    },
    
    addmyExperience(id,newExperience)  {
        return request({
            url: `/member/experience/addOneOne`,
            method: 'post',
            data: {
                chapterId: id,
                content: newExperience,
                username:JSON.parse(localStorage.getItem("user")).username
              
            }

        })
    },
    addvisits(bookId)  {
        return request({
            url: `/member/books/addVisits`,
            method: 'post',
            data: {
                id: bookId
              
            }

        })
    },
    // //删除活期基金
    // deleteBankById(id) {
    //     return request({
    //         url: `/bank/delete/${id}`,
    //         method: 'get',

    //     })
    // },
   
}

